SpatialStream® Code Examples

Wetlands Display and Identify

This example demonstrates how to simply add layers to a map using a Map Layer object. The map layer uses the GetMap functional component to construct web requests and retrieve images, in this case Subdivision data , to display on the map.

GetMap

var layer = new Dmp.Layer.TileLayer("Wetlands", "SS");
layer.addChild("poly", "SS.Hazards.Wetlands/Wetlands", "", {
zIndex: 2, zoomRange: {
min: 15, max: 19
}
});
map.addEntity(layer);

layer = new Dmp.Layer.WmsLayer("WetlandsL", "SS" );
layer.addChild("label", "SS.Hazards.Wetlands/Wetlands", "SS.Hazards.Wetlands.Styles/Wetlands/Labels.sld.xml", {
zIndex: 3, zoomRange: {
min: 15, max: 19
}
});
map.addEntity(layer);

//----------------

// create the identify call
var url = "Identify.aspx" +
"?returnGeoType=3" +
// datasource to identify
"&dataSource=SS.Hazards.Wetlands/Wetlands" +
"&showSchema=false" +
"&lat=" + loc.latitude +
"&long=" + loc.longitude +
"&fields=*";

Dmp.Env.Connections["SS"].getJson(url, successCallback, errorCallback);


Run Sample   Back To Index